<div style="width:100%;overflow: hidden;">
    <a href="<?php echo site_url('Admin/user') ?>">
        <div class="col-md-3">
            <div class="tab-sum users">
                <div class="col-md-6">
                    <i class="fa fa-users fa-fw fa-5x"></i>
                </div>
                <div class="col-md-6 counter">
                    <span><?php echo count($user) ?></span>
                    Users
                </div>
            </div>
        </div>
    </a>
    <a href="<?php echo site_url('Admin/post_page') ?>">
        <div class="col-md-3">
            <div class="tab-sum posts">
                <div class="col-md-6">
                    <i class="fa fa-file-text fa-fw fa-5x"></i>
                </div>
                <div class="col-md-6 counter">
                    <span><?php echo count($post) ?></span>
                    Posts
                </div>
            </div>
        </div>
    </a>
    <a href="<?php echo site_url('Admin/category') ?>">
        <div class="col-md-3">
            <div class="tab-sum categories">
                <div class="col-md-6">
                    <i class="fa fa-tags fa-fw fa-5x"></i>
                </div>
                <div class="col-md-6 counter">
                    <span><?php echo count($category) ?></span>
                    Categories
                </div>
            </div>
        </div>
    </a>
    <a href="<?php echo site_url('Admin/location') ?>">
        <div class="col-md-3">
            <div class="tab-sum locations">
                <div class="col-md-6">
                    <i class="fa fa-map-marker fa-fw fa-5x"></i>
                </div>
                <div class="col-md-6 counter">
                    <span><?php echo count($location) ?></span>
                    Locations
                </div>
            </div>
        </div>
    </a>
</div>

<div id="summ-data">
    <div class="col-md-3">
        <h2 class="title-tab" style="border-bottom: 1px solid #269ABC;">Top 5 Users</h2>
        <?php $count_user = 1; foreach($user as $data_user): if($count_user > 5): break; endif; ?>
        <div class="tab-inner-loc">
            <span class="items-post">
                <?php echo $data_user['fullname_user'] ?><br/>
                <small><?php echo $data_user['username_user'] ?></small>
            </span>
        </div>
        <?php endforeach; ?>

        <h2 class="title-tab" style="border-bottom: 1px solid #EFAD4D;">Top 10 Categories</h2>
        <ul id="cloud-tag">
            <?php $count_category = 1; foreach($category as $data_category): if($count_category > 10): break; endif; ?>
            <li><?php echo $data_category['category_name'] ?></li>
            <?php $count_category++; endforeach; ?>
        </ul>
    </div>

    <div class="col-md-3">
        <h2 class="title-tab" style="border-bottom: 1px solid #F25050;">Top 10 Locations</h2>
        <?php $count_location = 1; foreach($location as $data_location): if($count_location > 10): break; endif; ?>
            <div class="tab-inner-loc">
                <span><?php echo $count_location ?></span>
                <span class="items">
                    <a target="_blank" href="Home/search/<?php echo $data_location['location_name'] ?>"><?php echo $data_location['location_name'] ?></a>
                </span>
            </div>
        <?php $count_location++; endforeach; ?>  
    </div>

    <div class="col-md-6">
        <h2 class="title-tab" style="border-bottom: 1px solid #5CB95A;">Top 5 Posts</h2>
        <?php $count_post = 1; foreach($post as $data_post): if($count_post > 5): break; endif; ?>
        <div class="tab-inner">
            <span>
                <img src="<?php echo base_url() ?>/Images/Post_Thumb/<?php echo $data_post['thumbnail'] ?>" width="130px"/>
            </span>
            <a target="_blank" href="<?php echo site_url() ?>/Home/post/<?php echo $data_post['id_post'] ?>"><?php echo $data_post['post_title'] ?></a>
            <br/><small><i class="fa fa-calendar fa-fw"></i> <?php echo substr($data_post['post_date'], 0,10) ?></small>
        </div>
        <?php $count_post++; endforeach; ?>
        
    </div>
</div>